#define _CRT_SECURE_NO_WARNINGS

#include"string.h"

void Teststring1()
{
	func::string s1("hello world");
	func::string s2;
	cout << s2.c_str() << endl;
	for (int i=0; i < s1.size(); i++)
	{
		cout << s1[i] <<" ";
	}
	cout << endl;
	func::string::iterator it = s1.begin();
	while (it != s1.end())
	{
		cout << *it << " ";
		it++;
	}
	cout << endl;
	//func::string::const_iterator cit = s1.begin();
	auto cit = s1.begin();
	while (cit != s1.end())
	{
		cout << *cit << " ";
		cit++;
	}
	cout << endl;
}
void Teststring2()
{
	func::string s3("hello world");
	s3.push_back('#');
	s3.append(" hello");
	cout << s3.c_str() << endl;
	cout << "------------------------" << endl;
	func::string s4("hello world");
	s4 += '#';
	s4 += " hello";
	cout << s4.c_str() << endl;
}
void Teststring3()
{
	func::string s4("hello world");
	/*s4.insert(0, 3, '#');
	cout << s4.c_str() << endl;*/
	s4.insert(3, "12345");
	cout << s4.c_str() << endl;
}
void Teststring4()
{
	func::string s5("hello world");
	s5.erase(5);
	cout << s5.c_str() << endl;
	func::string s6("hello hahaha");
	size_t found1 = s6.find('h',3);
	size_t found2 = s6.find("haha",3);
	cout << found1 << "  " << found2 << endl;
}

void Teststring5()
{
	/*func::string s7("hello world");
	s7.resize(8, 'x');
	cout << s7.c_str() << endl;
	
	s7.resize(13, 'x');
	cout << s7.c_str() << endl;

	s7 += '\0';
	s7 += "123456";
	cout << s7.c_str() << endl;
	cout << s7 << endl;*/

	func::string s8;
	cin >> s8;
	cout << s8 << endl;
	cin >> s8;
	cout << s8 << endl;

}

int main()
{
	//Teststring1();
	//Teststring2();
	//Teststring3();
	//Teststring4();
	Teststring5();
	
}